﻿
Public Module _variableconvertor
    Public Delegate Function convertDelegate(Of T)(ByVal var As bare_variable, ByRef o As T) As Boolean

    Public Function _bare_variable(ByVal var As bare_variable, ByRef o As bare_variable) As Boolean
        o = var
        Return True
    End Function

    Public Function _string(ByVal var As bare_variable, ByRef o As String) As Boolean
        o = Convert.ToString(var.value())
        Return True
    End Function

    Public Function _int(ByVal var As bare_variable, ByRef o As Int64) As Boolean
        Return convertor.toint64(var.value(), o)
    End Function

    Public Function _float(ByVal var As bare_variable, ByRef o As Double) As Boolean
        Return convertor.todouble(var.value(), o)
    End Function

    Public Function _bool(ByVal var As bare_variable, ByRef o As Boolean) As Boolean
        o = var.true()
        Return True
    End Function

    Public Function _t(Of T)(ByVal var As bare_variable, ByRef o As T) As Boolean
        Return convertor.cast(Of T)(var.value(), o)
    End Function
End Module
